home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / DeliBEEry.swf / scripts / frame_112 / PlaceObject2_158_29 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-06  |  1.9 KB  |  62 lines

  1. onClipEvent(enterFrame){
  2.    gravedad += 0.1;
  3.    _X = _X + avancex;
  4.    _Y = _Y + (avancey + gravedad);
  5.    if(Key.isDown(39))
  6.    {
  7.       avancex += 1;
  8.    }
  9.    if(Key.isDown(37))
  10.    {
  11.       avancex -= 1;
  12.    }
  13.    if(Key.isDown(38))
  14.    {
  15.       avancey -= 1;
  16.    }
  17.    if(Key.isDown(40))
  18.    {
  19.       avancey += 1;
  20.    }
  21.    if((!_root.caminotest.hitTest(this.getBounds(_root).xMin,this._y,true) or !_root.caminotest.hitTest(this.getBounds(_root).xMax,this._y,true)) and control)
  22.    {
  23.       control = false;
  24.       this.avancex = 0;
  25.       this.avancey = 0;
  26.       this.gravedad = 0;
  27.       this.play();
  28.    }
  29.    if((!_root.caminotest.hitTest(this._x,this.getBounds(_root).yMin,true) or !_root.caminotest.hitTest(this._x,this.getBounds(_root).yMax,true)) and control)
  30.    {
  31.       control = false;
  32.       this.avancex = 0;
  33.       this.avancey = 0;
  34.       this.gravedad = 0;
  35.       this.play();
  36.    }
  37.    if(_root.hormiga.hitTest(this.getBounds(_root).xMin,this._y,true) or _root.hormiga.hitTest(this.getBounds(_root).xMax,this._y,true))
  38.    {
  39.       this.play();
  40.    }
  41.    if(_root.hormiga.hitTest(this._x,this.getBounds(_root).yMin,true) or _root.hormiga.hitTest(this._x,this.getBounds(_root).yMax,true))
  42.    {
  43.       this.play();
  44.    }
  45.    if(_root.hormvola.hitTest(this.getBounds(_root).xMin,this._y,true) or _root.hormvola.hitTest(this.getBounds(_root).xMax,this._y,true))
  46.    {
  47.       this.play();
  48.    }
  49.    if(_root.hormvola.hitTest(this._x,this.getBounds(_root).yMin,true) or _root.hormvola.hitTest(this._x,this.getBounds(_root).yMax,true))
  50.    {
  51.       this.play();
  52.    }
  53.    if(_root.arania.hitTest(this.getBounds(_root).xMin,this._y,true) or _root.arania.hitTest(this.getBounds(_root).xMax,this._y,true))
  54.    {
  55.       this.play();
  56.    }
  57.    if(_root.arania.hitTest(this._x,this.getBounds(_root).yMin,true) or _root.arania.hitTest(this._x,this.getBounds(_root).yMax,true))
  58.    {
  59.       this.play();
  60.    }
  61. }
  62.